#include <bits/stdc++.h>
using namespace std;
#define int long long
string s;
int a,b;
int n;
string ans="";
void dfs(int c,int x,int y)
{
    
    if(c==n||(!x&&!y))
    {
        if(s>ans)ans=s;
        return ;
    }
    char tmp=s[c];
    if(tmp=='9')dfs(c+1,x,y);
    else
    {
        if(x>=(9-(s[c]-'0')))
        {
            s[c]='9';
            dfs(c+1,x-(9-(tmp-'0')),y);
            s[c]=tmp;
        }
        else if(x)
        {
            s[c]+=x;
            dfs(c+1,0,y);
            s[c]=tmp;
        }
        if(y>=(1+(s[c]-'0')))
        {
            s[c]='9';
            dfs(c+1,x,y-(1+(tmp-'0')));
            s[c]=tmp;
        }
        if(!x)dfs(c+1,x,y);
    }
    
}
void solve()
{
    
    cin>>s>>a>>b;
    n=s.size();
    dfs(0,a,b);
    cout<<ans<<endl; 
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T=1;
    //cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}